---
title: Releasing (internal)
hidden: true
noindex: true
---

## Releasing (Deb/PPA + PyPI)

### Prereqs
- Docker on your host (for Docker-based deb builds)
- Ubuntu 24.04 shell/container for Debian tooling:
  - apt-get install -y build-essential devscripts debhelper dh-python fakeroot lintian docker.io dput gnupg

### Build CLI .deb locally (no host pollution)
1) Start a clean builder that talks to host Docker:
```bash
docker run --rm -it \
  -v "$PWD":/src -w /src \
  -v /var/run/docker.sock:/var/run/docker.sock \
  ubuntu:24.04 bash
```
2) Inside the container:
```bash
apt-get update
apt-get install -y build-essential devscripts debhelper dh-python fakeroot lintian docker.io
dpkg-buildpackage -b -d
ls -la ../k7_*_amd64.deb
```
3) Test install:
```bash
dpkg -i ../k7_*_amd64.deb || apt-get -y -f install
k7 -V
```

Notes:
- debian/rules uses Docker to compile the Nuitka onefile and packages only /usr/bin/k7.
- We disable strip/dwz so the onefile payload remains intact.

### Prepare and upload source to Launchpad PPA
You can smoke-test locally without signing:
```bash
dpkg-buildpackage -S -sa -d
lintian -i ../k7_*_source.changes
```

Signed upload (requires your GPG key registered on Launchpad):
```bash
gpg --batch --import /path/to/your-private-key.asc
KEYID=$(gpg --list-keys --with-colons | awk -F: '/^pub/ {print $5; exit}')
dpkg-buildpackage -S -sa -k"$KEYID"
dput ppa:katakate.org/k7 ../k7_*_source.changes
```

Helper script:
```bash
scripts/test-launchpad-build.sh            # unsigned
scripts/test-launchpad-build.sh -s KEYID   # signed
```

Versioning:
- Update `src/k7/__init__.py` before tagging.
- For native format (3.0 native), `debian/changelog` versions like `0.0.1` (no `-1`).

### GitHub CI (tags vX.Y.Z)
- PyPI publish: builds sdist/wheel and uploads with `PYPI_API_TOKEN`.
- Deb artifact: builds .deb via Docker (make build), uploads artifact.
- Launchpad upload: builds signed source with `dpkg-buildpackage -S -sa -d` and `PPA_GPG_PRIVATE_KEY`.

### Publish katakate (PyPI SDK) locally
1) Bump version in `src/katakate/__init__.py`.
2) Build and upload:
```bash
python -m pip install --upgrade pip build twine
python -m build
twine upload dist/*
```

Notes:
- Only `src/katakate` is packaged for PyPI; assets in `src/k7/*` are not part of the SDK.
- Ensure `~/.pypirc` or `TWINE_USERNAME=__token__` and `TWINE_PASSWORD=<pypi-token>` are set.


